package com.zmht.beike.biz.impl;

import java.util.List;

import com.zmht.beike.biz.CweekinfoBiz;
import com.zmht.beike.core.BaseBizImpl;
import com.zmht.beike.po.TCweekinfo;

public class CweekinfoBizImpl extends BaseBizImpl implements CweekinfoBiz {

	public List getCweekinfo(Integer teacherID, int startIndex, int pageSize) {
		String hql = "from TCweekinfo t where t.teacherId="+teacherID+" order by t.id desc";
		
		return this.getCweekinfoDAO().findByPage(hql, startIndex, pageSize);
		
	}
	public int getCweekinfoToatl(Integer teacherID) {
		String hql = "from TCweekinfo t where t.teacherId="+teacherID;
		return this.getCweekinfoDAO().findByHQLObj(hql).size();
	}
	/*
	 * 保存周主题信息
	 * (non-Javadoc)
	 * @see com.zmht.beike.biz.CweekinfoBiz#saveCweekinfo(com.zmht.beike.po.TCweekinfo)
	 */
	public Integer saveCweekinfo(TCweekinfo weekinfo) {
		try{
			return (Integer)this.getCweekinfoDAO().saveObj(weekinfo);
		}catch(Exception e){
			return 0;
		}
		
	}
	public List findByHQL(String hql) {
		return this.getCweekinfoDAO().findByHQLObj(hql);
	}
	

}
